global vSlider1, ValorT, Valor, MESPrite, ValorDia, Lmes, VMes1, VMes2, VMes3
puppetSprite(MESPrite, 0)
cursor([71, 72])
set the constraint of sprite gSlider to gLinea
set vBottom1 to the bottom of sprite gSlider
set vTop1 to the top of sprite gLinea
repeat while the stillDown
set the locV of sprite gSlider to the mouseV
set Valor to the locV of sprite gSlider
updateStage()
end repeat
set Valor to integer(Valor)
if Valor < 13 then
set Valor to 13
end if
set ValorT to integer(Valor / 13)
set VMes1 to getAt(Lmes, ValorT) - Valor
if ValorT = 1 then
nothing()
else
set VMes2 to getAt(Lmes, ValorT - 1) - Valor
end if
set VMes3 to getAt(Lmes, ValorT + 1) - Valor
if (abs(VMes1) <= abs(VMes2)) and (abs(VMes1) < abs(VMes3)) then
set ValorT to ValorT
end if
if (abs(VMes2) < abs(VMes1)) and (abs(VMes2) < abs(VMes3)) then
set ValorT to ValorT - 1
end if
if (abs(VMes3) < abs(VMes2)) and (abs(VMes3) < abs(VMes1)) then
set ValorT to ValorT + 1
end if
if ValorDia <> ValorT then
set the locV of sprite gSlider to getAt(Lmes, ValorT) + 2
set MESPrite to ValorT + 10
set the memberNum of sprite MESPrite to the memberNum of sprite MESPrite + 1
updateStage()
if ValorT < 1 then
set ValorT to 1
end if
if ValorT > 31 then
set ValorT to 31
end if
if (ValorT > 28) and (VMesA = 2) then
set ValorT to 28
end if
set ValorDia to ValorT
tell the stage
BuscaDia(ValorDia)
end tell
else
set the locV of sprite gSlider to getAt(Lmes, ValorT) + 2
set MESPrite to ValorT + 10
puppetSprite(MESPrite, 0)
set ValorDia to ValorT
updateStage()
end if
end
on mouseUp me
end
on mouseEnter me
cursor([71, 72])
set the memberNum of sprite the currentSpriteNum to the memberNum of sprite the currentSpriteNum + 1
end
on mouseLeave me
cursor(-1)
set the memberNum of sprite the currentSpriteNum to the memberNum of sprite the currentSpriteNum - 1
end
on mouseUpOutSide me
end
on getBehaviorDescription
return "Para controlar la Barra de los Dias. AFC" & RETURN & "P.D:" & RETURN & "Al que lo copie que pregunte por que tiene más de un truco:-)" & RETURN